ADD_DEFINITIONS(${SIMD_FLAGS})

CHECK_SYMBOL_EXISTS("__MINGW32__" "" IS_MINGW)
IF(IS_MINGW)
    ADD_DEFINITIONS("-mwindows")
    SET(PLATFORM_SPECIFIC_LIBS mingw32)
ENDIF()

INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}
                    ${CMAKE_CURRENT_SOURCE_DIR}
                    ${CMAKE_CURRENT_BINARY_DIR}
                    ${CARINA_ENGINE_INCLUDE_DIRS}
                    )

SET(SETTINGS_SRC
    settings-dialog.cc
    settings-main.cc
    )

SET(SETTINGS_M_H
    settings-dialog.hh
    )

SET(SETTINGS_H 
    ${SETTINGS_M_H}
    )

SET(SETTINGS_UI
    settings.ui
    )

SET(SETTINGS_RESOURCES
    ${CARINA_TOOLS_DIR}/share/settings.qrc
    )

FIND_PACKAGE(Qt5Widgets)

QT5_ADD_RESOURCES(SETTINGS_RES_SRC ${SETTINGS_RESOURCES})
QT5_WRAP_CPP(SETTINGS_MOC_SRC ${SETTINGS_M_H})
QT5_WRAP_UI(SETTINGS_UI_H ${SETTINGS_UI})
ADD_EXECUTABLE(carina_settings WIN32 
            ${SETTINGS_SRC} 
            ${SETTINGS_MOC_SRC} 
            ${SETTINGS_H} 
            ${SETTINGS_UI_H} 
            ${SETTINGS_RES_SRC}
            )

QT5_USE_MODULES(carina_settings Widgets)

TARGET_LINK_LIBRARIES(carina_settings carina_engine ${PLATFORM_SPECIFIC_LIBS} ${QT_LIBRARIES})

INSTALL(TARGETS carina_settings DESTINATION bin)
